<template>
    <div class="nav">
        <div class="logo">
            <img src="../assets/logo.jpg" alt="">
        </div>
        <div class="menu">
            <el-menu 
                router
                :default-active='active_menu'
                background-color="#545c64" 
                text-color="#fff" 
                active-text-color="#fff"
            >
                <el-menu-item index="/">
                    <i class="el-icon-s-home"></i>
                    <span slot="title">首页</span>
                </el-menu-item>
                <el-menu-item index="/merchant/list">
                    <i class="el-icon-s-shop"></i>
                    <span slot="title">商户</span>
                </el-menu-item>
                <el-menu-item index="/proxy/list" v-if="show==1">
                    <i class="el-icon-location"></i>
                    <span slot="title">区域代理</span>
                </el-menu-item>
                <!-- <el-menu-item index="/personnel/list">
                    <i class="el-icon-user"></i>
                    <span slot="title">员工</span>
                </el-menu-item> -->
                <el-menu-item index="/lineup/list">
                    <i class="el-icon-tickets"></i>
                    <span slot="title">排单列表</span>
                </el-menu-item>
                <!-- <el-menu-item index="/commission/list">
                    <i class="el-icon-coin"></i>
                    <span slot="title">佣金明细</span>
                </el-menu-item> -->
            </el-menu>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            show:JSON.parse(localStorage.getItem('userinfo')).agentlevel,
            active_menu:''
        }
    },
    mounted(){
        this.active_menu = this.$route.meta.p
    },
    methods:{

    },
    beforeRouteUpdate (to, from, next) {
        this.active_menu = to.fullPath
        next()
    }
}
</script>
<style lang="scss" scoped>
    .nav{
        .logo{
            height: 60px;
            text-align: center;
            img{
                width: 60px;
            }
        }
        .el-menu{
            min-height: calc(100vh - 60px);
            border: 0;
        }
        ::v-deep .el-menu-item{
            text-align: left;
        }
        .is-active{
            background-color: #333!important;
        }
    }
</style>